package com.phiture.erp.finance.common.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ErpFinanceStatementStatusEnum {
    TO_BE_CONFIRMED(0, "待确认"),
    CONFIRMED(1, "已确认"),
    PARTIAL_SETTLEMENT(2, "部分结算"),
    ALREADY_SETTLED(3, "已结算");

    private final Integer status;
    private final String description;


    public static ErpFinanceStatementStatusEnum fromStatus(int status) {
        for (ErpFinanceStatementStatusEnum value : values()) {
            if (value.status == status) {
                return value;
            }
        }
        throw new IllegalArgumentException("无效的状态码: " + status);
    }
}
